package com.xul.srb.sms.util;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author xul
 * @create 2021-11-25 0:07
 */
@Data
@Component
@ConfigurationProperties("short.messages")
public class ShortMessageProperties implements InitializingBean {

    private String host;
    private String path;
    private String method;
    private String appcode;
    private String skin;

    public static String HOST;
    public static String PATH;
    public static String METHOD;
    public static String APPCODE;
    public static String SKIN;


    /**
     * 当私有成员被赋值后 此方法自动被调用 从而初始化常量
     *
     * @throws Exception
     */
    @Override
    public void afterPropertiesSet() throws Exception {
        HOST = host;
        PATH = path;
        METHOD = method;
        APPCODE = appcode;
        SKIN = skin;
    }
}

